<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户信息</title>
    <meta name="context-path" th:content="@{/}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap-responsive.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/colorpicker.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/datepicker.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/uniform.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/select2.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-style.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-media.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-full.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/font-awesome/css/font-awesome.css}"/>
    <link rel="stylesheet" th:href="@{/resources/valid/css/bootstrapValidator.css}"/>
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/resources/css/website.css}"/>
</head>
<body class="childbody">
<div class="container-fluid editform_fluid">
    <!--Chart-box-->
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title"><span class="icon"> <i class="icon-align-justify"></i> </span>
                <h5>用户</h5>
            </div>
            <div class="widget-content">
                <form id="detailform" class="form-horizontal" th:object="${entity}">
                    <input type="hidden" id="id" name="id" th:value="*{id}"/>
                    <div class="control-group">
                        <label class="control-label">用户名 :</label>
                        <div class="controls  form-group">
                            <input type="text" name="name" th:value="*{userName}" class="span11 form-control" disabled="disabled"
                                   placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">真实姓名 :</label>
                        <div class="controls  form-group">
                            <input type="text" name="realName" th:value="*{realName}" class="span11 form-control" disabled="disabled" placeholder="请输入真实姓名">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">身份证号：</label>
                        <div class="controls form-group">
                            <input type="text" name="idcard" th:value="*{idcard}"  class="span11 form-control" disabled="disabled" placeholder="请输入身份证号">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">角色：</label>
                        <div class="controls form-group">
                            <select class="span11 form-control" name="role" th:field="*{role}" disabled="disabled">
                                <option th:each="rl : ${roles}" th:value="${rl.id}"
                                        th:text="${rl.roleName}" ></option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">地址：</label>
                        <div class="controls form-group">
                            <textarea class="span11 form-control" name="address" th:text="*{address}" disabled="disabled"></textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">描述：</label>
                        <div class="controls form-group">
                            <textarea class="span11 form-control" name="description" th:text="*{description}" disabled="disabled"></textarea>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button id="btnSubmit" type="button" class="btn btn-success">修改密码</button>
                        <button id="btnMessage" type="button" class="btn btn-primary">查看聊天记录</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/resources/js/jquery.min.js}"></script>
<script th:src="@{/resources/js/jquery-migrate-1.2.1.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.ui.custom.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap.min.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap-colorpicker.js}"></script>
<script th:src="@{/resources/matrix/js/bootstrap-datepicker.js}"></script>
<script th:src="@{/resources/matrix/js/masked.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.uniform.js}"></script>
<script th:src="@{/resources/matrix/js/select2.min.js}"></script>
<script th:src="@{/resources/matrix/js/matrix.js}"></script>
<script th:src="@{/resources/matrix/js/jquery.peity.min.js}"></script>
<script th:src="@{/resources/layui/layui.all.js}" charset="utf-8"></script>
<script th:src="@{/resources/valid/js/bootstrapValidator.js}"></script>
<script th:src="@{/resources/valid/js/language/zh_CN.js}"></script>
<script th:src="@{/resources/js/website.js}"></script>
<script th:src="@{/resources/js/system.js}"></script>
<script th:src="@{/resources/js/validation_fields.js}"></script>
<script th:inline="javascript">
    var contextRoot = $("meta[name='context-path']").attr("content");
</script>

<script th:inline="javascript">
    var ListViewMessage = function (layer, params) {
        var self = this;
        self.title = params.title;
        self.url = params.url;
        self.width = params.width;
        self.height = params.height;
        self.isfull = params.isfull ? true : false;
        self.layerIndex = null;
        self.openDialog = function () {
            var id = $("#id").val();
            self.layerIndex = layer.open({
                type: 2,
                title: self.title,
                shadeClose: true,
                skin: 'layui-layer-lan',
                offset: '20px',
                shade: 0.8,
                area: [self.width, self.height],
                content: self.url + "/" + id,
                maxmin: self.isfull
            });
            if (self.isfull == true) {
                layer.full(self.layerIndex);
            }
        }
        self.closeDialog = function () {
            layer.close(self.layerIndex);
        };
        self.editCompleted = function () {
            self.closeDialog();
        }
    };

    var edit,viewMessage;
    layui.use(['jquery', 'layer', 'laydate'], function () {


        edit = new updatePassword(layer, {
            title: "修改用户",
            url: contextRoot + "author_manage/user/getEditPassword",
            width: "730px",
            height: "600px"
        });

        viewMessage = new ListViewMessage(layer, {
            title: "查看聊天记录",
            url: contextRoot + "schoolStudentParent/getMessageListByUser",
            width: "1100px",
            isfull: true,
            height: "600px"
        });

        $("#btnSubmit").bind("click", function (event) {
            edit.openDialog();
        });

        $("#btnMessage").bind("click", function (event) {
            viewMessage.openDialog();
        });


    });

</script>
</body>
</html>